home *** CD-ROM | disk | FTP | other *** search
/ Enter 2010 January / ENTER_2010_01.iso / Programy / Gry / Base_Invaders_ / BaseInvadersSetup1.3.exe / {app} / Scripts / HudTest.lua < prev    next >
Encoding:
Text File  |  2007-01-25  |  1.4 KB  |  54 lines

  1. G.SetGroup( "Cam" )
  2. local Cam = G.Create( "Data/BasicCamera.xml");
  3. local pos = Vector3(-10,0,0);
  4. Cam.SetPosition( pos );
  5.  
  6. --G.AddLine( Vector3(0,0,0) , Vector3(200,0,0)  );
  7. --G.AddLine( Vector3(0,0,0) , Vector3(200,0,0)  );
  8.  
  9. G.Create( "Data/Terra.xml" );
  10.  
  11. local obj = G.Create( "Data/ModelCog.xml" );
  12. obj.SetPosition( Vector3(60,20,60) );
  13. --obj.SetAnimation( "Fire" );
  14.  
  15. rpos = Vector3(60,20,60);
  16. function SpawnBolts()
  17.     local r = math.random( 0 , 300 );    
  18.     if( r == 0 ) then
  19.         local offset = math.random() * 3.1468;
  20.         local numBolts = 3;
  21.         for y=1,numBolts  do         
  22.             vVector = Vector3();
  23.             vVector[1] = (math.random() * 2 - 1) * 0.5;
  24.             --vVector[1] = 0;
  25.             local radius = math.sqrt(1.0 - vVector[1] * vVector[1] );
  26.             --local t = (math.random() * 2 - 1) * 3.1468;
  27.             local t = y * (2*3.14)/ numBolts;
  28.             vVector[0] = math.cos( offset + t ) * radius;
  29.             vVector[2] = math.sin( offset + t ) * radius;            
  30.             G.AddLine( Vector3(60,25,60)  , Vector3(60,25,60)  + vVector * 8 );    
  31.         end
  32.     end
  33. end
  34.  
  35.  
  36. --numBolts = 5;
  37. --for y=1,numBolts do     
  38.     --local t =  y * (2*3.14)/ numBolts;
  39.     --local tpos2 = Vector3(  math.cos( t ) * 60 , 0  ,  math.sin( t ) * 60  );
  40.     --local tpos = Vector3(  math.cos( t ) * 120 , 0  ,  math.sin( t ) * 120  );
  41.     --G.AddLine( tpos2 ,tpos  );
  42. --end    
  43.  
  44.  
  45.             
  46. GMain[ "SpawnBolts" ] = SpawnBolts;
  47. --Obj = G.Create( "Data/KnotCog.xml" );
  48. --Obj.SetPosition( Vector3(90, 0 , 90) );
  49.  
  50.  
  51.  
  52.  
  53.  
  54.